<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">消费机构信息</a></li>
			<li><a href="{:U('AdminSale/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">添加消费机构</a></li>
		</ul>
        <form class="well form-search" id="form_search" method="post" action="{:U('AdminSale/index')}">
        	<select name="s_smid" style="margin:0px;">
        	    <option value="">请选择消费管理机构</option>
        	    <foreach name="sale_manager_list" item="sitem">
        	        <option value="{$sitem['id']}" <if condition="$s_smid == $sitem['id']">selected</if>>{$sitem.sale_manage_name}</option>
        	    </foreach>
        	</select>
            关键词：
            <input type="text" name="keyword" style="width: 200px;" value="{$keyword}" placeholder="请输入关键字...">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:U('AdminSale/index')}">清空</a>
			<a class="btn btn-primary" style="float: right;margin-right:15px;margin-bottom:10px;" href="javascript:downloadExcel(1);">导出报表</a>
			<input type="hidden" name="s_download" id="s_download" value="0"/>
        </form>
		<form class="js-ajax-form" action="" method="post">

			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="10"></th>
						<th width="50">上级消费机构</th>
                        <th width="50">消费机构名称</th>
                        <th width="50">累计消费金额</th>
                        <th width="50">二维码</th>
                        <th width="50">创建时间</th>
						<th width="70">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<foreach name="list" item="vo">
				<if condition="$vo['delete_time']">
				<tr class="deleted">
				<else />
				<tr class="show_chlid">
				</if>
                    <td>
						<b>
							<span class="arrow_right"></span>
					</b></td>
					<td>{$vo.sale_manage_name}</td>
                    <td><b>{$vo.sale_name}</b></td>
                    <td>{$vo.price}</td>
                    <td><img src="./public/qrcode/{$vo.id}.png" width="100"/></td>
					<td>{:date("Y-m-d H:i:s",$vo['create_time'])}</td>

					<td class="undeleted">
						<if condition="$vo['delete_time']">
							<a href='{:U("AdminSale/overdelete",array("id"=>$vo["id"]))}'>彻底删除</a> |
							<a href='{:U("AdminSale/restore",array("id"=>$vo["id"]))}'>恢复数据</a>
						<else />
							<a href="{:U('AdminSale/add',array('id'=>$vo['id']))}">{:L('EDIT')}</a> |
							<a href="{:U('AdminSale/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
						</if>
					</td>
				</tr>
				<tr class="tr_chlid">
				  	<td colspan="10">
				      	<ul>
				          	<li style="font-weight: bold;">商品列表：</li>
							<foreach name="vo.sale_goods" item="voo">
								<li>	{$voo.good_name}：	{$voo.good_unit_price}	|	{$voo.vip_good_unit_price}</li>
							</foreach>
				      </ul>
				  </td>
				</tr>
				</foreach>

			</table>

			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminSale/index',$formget)}";
			}
		}

	</script>
</body>
</html>